package com.dgut.medicalsystem.jms;

import com.dgut.medicalsystem.entity.Notice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.jms.Destination;

@Service
public class Producer {

    @Resource
    private JmsMessagingTemplate jmsMessagingTemplate;

    @Autowired
    Destination destination;

    public void sendMsg(Notice notice) {
        System.out.println("生产者在生产");
        jmsMessagingTemplate.convertAndSend(destination, notice);
    }
}
